﻿// Decompiled with JetBrains decompiler
// Type: Netick.Unity.NetworkEvents
// Assembly: Netick.Unity, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E128C7FD-39ED-4452-86AC-6EC748457030
// Assembly location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.Unity.dll
// XML documentation location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.Unity.xml

using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

#nullable disable
namespace Netick.Unity;

[AddComponentMenu("Netick/Network Events")]
[Obsolete("This component will be removed in the future.")]
public class NetworkEvents : NetworkEventsListener
{
  public NetworkEvents.OnConnectRequestEvent onConnectRequest;
  public NetworkEvents.OnConnectFailedEvent onConnectFailedEvent;
  public NetworkEvents.OnStartupEvent onStartup;
  public NetworkEvents.OnShutdownEvent onShutdown;
  public NetworkEvents.OnInputEvent onInput;
  public NetworkEvents.OnSceneLoadedEvent onSceneLoaded;
  public NetworkEvents.OnSceneLoadStartedEvent onSceneLoadStarted;
  public NetworkEvents.OnClientConnectedEvent onClientConnected;
  public NetworkEvents.OnClientDisconnectedEvent onClientDisconnected;
  public NetworkEvents.OnConnectedToServerEvent onConnectedToServer;
  public NetworkEvents.OnDisconnectedFromServerEvent onDisconnectedFromServer;
  public NetworkEvents.OnObjectCreatedEvent onObjectCreated;
  public NetworkEvents.OnObjectDestroyedEvent onObjectDestroyed;
  public NetworkEvents.OnMatchListUpdateEvent onMatchList;
  public NetworkEvents.OnMatchCreatedEvent onMatchCreated;

  public override void OnConnectRequest(NetworkSandbox sandbox, NetworkConnectionRequest request)
  {
    this.onConnectRequest?.Invoke(sandbox, request);
  }

  public override void OnConnectFailed(NetworkSandbox sandbox, ConnectionFailedReason reason)
  {
    this.onConnectFailedEvent?.Invoke(sandbox, reason);
  }

  public override void OnInput(NetworkSandbox sandbox) => this.onInput?.Invoke(sandbox);

  public override void OnStartup(NetworkSandbox sandbox) => this.onStartup?.Invoke(sandbox);

  public override void OnShutdown(NetworkSandbox sandbox) => this.onShutdown?.Invoke(sandbox);

  public override void OnSceneLoaded(NetworkSandbox sandbox) => this.onSceneLoaded?.Invoke(sandbox);

  public override void OnSceneLoadStarted(NetworkSandbox sandbox)
  {
    this.onSceneLoadStarted?.Invoke(sandbox);
  }

  public override void OnConnectedToServer(NetworkSandbox sandbox, NetworkConnection server)
  {
    this.onConnectedToServer?.Invoke(sandbox, server);
  }

  public override void OnDisconnectedFromServer(
    NetworkSandbox sandbox,
    NetworkConnection server,
    TransportDisconnectReason transportDisconnectReason)
  {
    this.onDisconnectedFromServer?.Invoke(sandbox, server, transportDisconnectReason);
  }

  public override void OnClientConnected(NetworkSandbox sandbox, NetworkConnection client)
  {
    this.onClientConnected?.Invoke(sandbox, client);
  }

  public override void OnClientDisconnected(
    NetworkSandbox sandbox,
    NetworkConnection client,
    TransportDisconnectReason transportDisconnectReason)
  {
    this.onClientDisconnected?.Invoke(sandbox, client, transportDisconnectReason);
  }

  public override void OnObjectCreated(NetworkObject obj) => this.onObjectCreated?.Invoke(obj);

  public override void OnObjectDestroyed(NetworkObject obj) => this.onObjectDestroyed?.Invoke(obj);

  public override void OnMatchListUpdate(NetworkSandbox sandbox, List<Session> sessions)
  {
    this.onMatchList?.Invoke(sandbox, sessions);
  }

  public override void OnMatchCreated(NetworkSandbox sandbox)
  {
    this.onMatchCreated?.Invoke(sandbox);
  }

  [Serializable]
  public class OnConnectRequestEvent : UnityEvent<NetworkSandbox, NetworkConnectionRequest>
  {
  }

  [Serializable]
  public class OnConnectFailedEvent : UnityEvent<NetworkSandbox, ConnectionFailedReason>
  {
  }

  [Serializable]
  public class OnStartupEvent : UnityEvent<NetworkSandbox>
  {
  }

  [Serializable]
  public class OnShutdownEvent : UnityEvent<NetworkSandbox>
  {
  }

  [Serializable]
  public class OnInputEvent : UnityEvent<NetworkSandbox>
  {
  }

  [Serializable]
  public class OnSceneLoadedEvent : UnityEvent<NetworkSandbox>
  {
  }

  [Serializable]
  public class OnSceneLoadStartedEvent : UnityEvent<NetworkSandbox>
  {
  }

  [Serializable]
  public class OnObjectCreatedEvent : UnityEvent<NetworkObject>
  {
  }

  [Serializable]
  public class OnObjectDestroyedEvent : UnityEvent<NetworkObject>
  {
  }

  [Serializable]
  public class OnClientConnectedEvent : UnityEvent<NetworkSandbox, NetworkConnection>
  {
  }

  [Serializable]
  public class OnClientDisconnectedEvent : 
    UnityEvent<NetworkSandbox, NetworkConnection, TransportDisconnectReason>
  {
  }

  [Serializable]
  public class OnConnectedToServerEvent : UnityEvent<NetworkSandbox, NetworkConnection>
  {
  }

  [Serializable]
  public class OnDisconnectedFromServerEvent : 
    UnityEvent<NetworkSandbox, NetworkConnection, TransportDisconnectReason>
  {
  }

  [Serializable]
  public class OnMatchListUpdateEvent : UnityEvent<NetworkSandbox, List<Session>>
  {
  }

  [Serializable]
  public class OnMatchCreatedEvent : UnityEvent<NetworkSandbox>
  {
  }
}
